package com.oj.dfs;

import java.util.Scanner;

public class KthShortestPath {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()) {
            int row = scanner.nextInt();
            int col = scanner.nextInt();
            int[][] graph = new int[row][col];
            for (int i = 0; i < row; i++) {
                for (int j = 0; j < col; j++) {
graph[i][j] =  0;
                }
            }
            for (int i = 0; i < row; i++) {
                for (int j = 0; j < col; j++) {
                    int x = scanner.nextInt();
                    int y = scanner.nextInt();
                    int weight = scanner.nextInt();
                    graph[x][y] = weight;
                }
            }

        }
    }

    private static final int MAX_DIS = 10000000;

}
